package com.zh.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description: 可以使用自定义类扩展MVC的功能
 * @ClassName WebMvcConfig
 * @date: 2021.05.10 14:57
 * @Author: zhanghang
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    // 纯路由注册
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/").setViewName("index");
    }


}
